home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_revive.cog < prev    next >
Text File  |  1998-02-25  |  2KB  |  73 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # POW_REVIVE.COG
  4. #
  5. # POWERUP Script - Revive
  6. #
  7. # [YB & CYW]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. sound       pickupsnd=helthpu1.wav           local
  17. sound       respawnsnd=Activate01.wav        local
  18. flex        amount                           local
  19.  
  20. message     touched
  21. message     taken
  22. message     respawn
  23.  
  24. end
  25.  
  26. # ========================================================================================
  27.  
  28. code
  29.  
  30. touched:
  31.    player = GetSourceRef();
  32.    amount = GetInv(player, 60);
  33.  
  34.    if ((amount < GetInvMax(player, 60)) || (GetThingHealth(player) < 100))
  35.    {
  36.       TakeItem(GetSenderRef(), -1);
  37.       call taken;
  38.    }
  39.  
  40.    Return;
  41.  
  42. # ........................................................................................
  43.  
  44. taken:
  45.    player = GetSourceRef();
  46.    powerup = GetSenderRef();
  47.  
  48.    // Print("Revive");
  49.    jkPrintUNIString(player, 66);
  50.  
  51.    // Do effects.
  52.    PlaySoundLocal(pickupsnd, 1, 0, 0);
  53.    AddDynamicTint(player, 0.0, 0.0, 0.2);
  54.  
  55.    // Max Health.
  56.    SetThingHealth(player, 100);
  57.  
  58.    // Max Shield
  59.    SetInv(player, 60, GetInvMax(player, 60));
  60.  
  61.    Return;
  62.  
  63. # ........................................................................................
  64.  
  65. respawn:
  66.    PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
  67.  
  68.    Return;
  69.  
  70. end
  71.  
  72.  
  73.